package com.ddx.common.enums;

/**
 * 加息券 和  特权本金 状态
 *
 */
public enum CardAndRedStatus {
    UNUSED(0,"去激活"),
    USEING(1,"计息中"),
    BEENUSED(2,"已使用"),
    EXPIRED(3,"已失效");//已过期
    private Integer code;
    private String msg;

    CardAndRedStatus(Integer code, String msg) {
        this.code=code;
        this.msg=msg;
    }
    private static CardAndRedStatus[] vals = values();

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static CardAndRedStatus getCardAndRedStatus(Integer code) {
        for (CardAndRedStatus t : vals) {
            if (code.equals(t.getCode())) {
                return t;
            }
        }
        return null;
    }
//    public CardAndRedStatus next() {
//        return vals[(this.ordinal() + 1) % vals.length];
//    }
//    public CardAndRedStatus end(){
//        return EXPIRED;
//    }
}
